home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / D-G / FORTRAN Goodies / FORTRAN Macros for EXCEL / Source Code / DataK1.f < prev    next >
Encoding:
Text File  |  1992-01-31  |  1.1 KB  |  53 lines  |  [TEXT/MPS ]

  1. !!MP Inlines.f
  2.  
  3. C    An example of a FORTRAN Resource for Microsoft Excel 3.0
  4. C    This example call illustrates the use of the Passing a Pointer to an
  5. C    Array Structure, Data Type K. Testing for this example was done with
  6. C    Language Systems FORTRAN version 3.0
  7. C    
  8. C    Below are the commands that were executed to create the 
  9. C    code resource
  10.  
  11. !!IFC FALSE
  12.  FORTRAN DATAK1.f -opt=1 -noimplicit
  13. Link -w -f -srt -ad 4 -t '????' -c '????' ∂
  14. -m DATAK1 -sn Main=DATAK1 ∂
  15. -sn f_RunTime=DATAK1 ∂
  16. -sn f_Intrinsics=DATAK1 ∂
  17.     DATAK1.f.o ∂
  18.     "{FLibraries}"OutpwStubs.o ∂
  19.     "{Libraries}"Runtime.o ∂
  20.     "{Libraries}"Interface.o ∂
  21.     "{FLibraries}"FORTRANlib.o ∂
  22.     "{FLibraries}"IntrinsicLib.o ∂
  23.     "{FLibraries}"FSANELib.o ∂
  24.     -o DATAK1.rsc
  25. !!ENDC
  26.  
  27. C    Source code
  28.  
  29.     integer*4 function DATAK1(%val(a),%val(value))
  30.     
  31.     integer*2 i, items
  32.     
  33.     pointer /real*8/ value
  34.     structure /fp/
  35.         integer*2 rows
  36.         integer*2 columns
  37.         real*8    dparray(100)
  38.     end structure
  39.     
  40.     pointer /fp/ a
  41.         
  42.     value^ = 0
  43.     items = a^.rows * a^.columns
  44.     do i = 1,items
  45.         value^ = value^ + a^.dparray(i)
  46.     enddo
  47.     DATAK1 = value
  48.     
  49.     return
  50.     end
  51.     
  52.         
  53.